using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using OgilvyOne.Model;
using OgilvyOne.IDAL;
namespace OgilvyOne.BLL
{
    public class StaffInfo
    {
        // Methods
        public bool addStaffScore(string strStaffId, string ruleId, string score)
        {
            return OgilvyOne.DALFactory.StaffInfo.Create().addScoreStaff(strStaffId, ruleId, score);
        }

        public void Delete(int Member_UID)
        {
            OgilvyOne.DALFactory.StaffInfo.Create().Delete(Member_UID);
        }

        public StaffInfoInfo getStaffInfo(int staffId)
        {
            return OgilvyOne.DALFactory.StaffInfo.Create().getStaffInfo(staffId);
        }

        public StaffInfoInfo getStaffInfo(string staffCode, string password)
        {
            return OgilvyOne.DALFactory.StaffInfo.Create().getStaffInfo(staffCode, password);
        }

        public IList getStaffListByName(StaffInfoInfo iinfo)
        {
            return OgilvyOne.DALFactory.StaffInfo.Create().getStaffList(iinfo);
        }

        public StaffInfoInfo getStaffSession()
        {
            return OgilvyOne.DALFactory.StaffInfo.Create().getStaffSession();
        }

        public static IList getUserList(int Member_UID)
        {
            return OgilvyOne.DALFactory.StaffInfo.Create().getMember_data(Member_UID);
        }

        public void InsertDeal(StaffInfoInfo iinfo)
        {
            IStaffInfo info = OgilvyOne.DALFactory.StaffInfo.Create();
            if (info.getStaffInfoCount(iinfo.StaffCode) == 0)
            {
                info.Insert(iinfo);
            }
            else
            {
                info.Update(iinfo);
            }
        }

        public void insertLoginLog(int staffId, string ip)
        {
            OgilvyOne.DALFactory.StaffInfo.Create().InsertLoginLog(staffId, ip);
        }

        public int isFirstLogin(string staffCode)
        {
            return OgilvyOne.DALFactory.StaffInfo.Create().isFirstLogin(staffCode);
        }

        public void Update(StaffInfoInfo member_DataInfo)
        {
            OgilvyOne.DALFactory.StaffInfo.Create().Update(member_DataInfo);
        }

        public void Update_Member(StaffInfoInfo member_DataInfo)
        {
            OgilvyOne.DALFactory.StaffInfo.Create().Update_Member(member_DataInfo);
        }

        public void updateLoginLog(int staffId, string ip)
        {
            OgilvyOne.DALFactory.StaffInfo.Create().UpdateLoginLog(staffId, ip);
        }

        public void UpdateSkin(int staffId, int skin)
        {
            OgilvyOne.DALFactory.StaffInfo.Create().UpdateSkin(staffId, skin);
        }

        public int UpdateStaffInfo(StaffInfoInfo staffInfoInfo)
        {
            return OgilvyOne.DALFactory.StaffInfo.Create().UpdateStaffInfo(staffInfoInfo);
        }

        public int UpdateStaffPasswd(int staffId, string newPasswd, string oldPasswd, string email)
        {
            return OgilvyOne.DALFactory.StaffInfo.Create().UpdateStaffPasswd(staffId, newPasswd, oldPasswd, email);
        }

    }
}
